/**
 * 功能描述
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");
    var template = require("./assets/tpl/prodType_main.tpl");
    
    //component
    var cForm = require("./view/prodTypeForm");
    var cGrid = require("./view/prodTypeGrid");
    var cNav = require("./view/prodTypeNav");
    
    var App = ELView.extend({
        attrs: {
            template: template
        },
        
        constant: require("./constant/prodTypeProps"),
        
        service: require("./svc/prodTypeSvc"),
        
        initComponent: function (params, widget) {
        	cNav.initComponent(widget);
        	cGrid.initComponent(widget);
        	cForm.initComponent(widget);
        },
		toList: function(){
			this.hide([".J-form"]).show([".J-grid"]);
			this.get("subnav").hide(["return"]).show(["add","search","seal"]);
		},
		toCard: function(){
			this.show([".J-form"]).hide([".J-grid"]);
			this.get("subnav").show(["return"]).hide(["add","search","seal"]);
		}
    });

    module.exports = App;
});
